import machine
import ubinascii
import gc


device_id = ubinascii.hexlify(machine.unique_id()).decode("utf-8")

print("设备ID：", device_id)

gc.collect()
free_m = gc.mem_free()
alloc_m = gc.mem_alloc()
print("Memory info>>  free: ", free_m / 1024, "KB alloc_m: ", alloc_m / 1024, "KB")

try:
    import esp

    flash_size = esp.flash_size() / 1024 / 1024
    print("flash size: ", flash_size)
except Exception as e:
    print(e)
